home *** CD-ROM | disk | FTP | other *** search
/ Aminet 34 / Aminet 34 (2000)(Schatztruhe)[!][Dec 1999].iso / Aminet / misc / emu / Electrostatic.lha / Electrostatic / hidden / Translate Game < prev    next >
Text File  |  1999-10-17  |  2KB  |  126 lines

  1. ; File: Install Atari 2600 Game
  2. ; Author: Neil Cafferkey
  3. ; =============================
  4. ; A script to translate an Atari 2600 game.
  5. ;
  6. ; $VER: "Install Atari 2600 Game" 2.2 (12.10.99)
  7.  
  8.  
  9. ; Set constants
  10.  
  11. (set #kick-too-low-msg "Kickstart 3.0 or greater is required.")
  12. (set #askdir-prompt "In which drawer should %s be installed?")
  13. (set #ask-name-prompt
  14.    "Please select the source drawer of the Atari 2600 game you want to translate:"
  15. )
  16. (set #ask-name-help @askstring-help)
  17. (set #translating-msg "Translating game...")
  18. (set #disassembly-error-msg
  19.    "An error occurred during the disassembly phase."
  20. )
  21. (set #assembly-error-msg
  22.    "An error occurred during the assembly phase."
  23. )
  24. (set #exit-msg
  25.    (cat "Installation complete!\n\n"
  26.       "%s can be found in \"%s\"."
  27.    )
  28. )
  29.  
  30.  
  31. ; Check Kickstart version
  32.  
  33. (if (< (/ (getversion) 65536) 39)
  34.    (abort #kick-too-low-msg)
  35. )
  36.  
  37.  
  38. ; Ask for the name of the game
  39.  
  40. (set #app-name (askdir (prompt #ask-name-prompt) (help #ask-name-help)
  41.    (default "games")
  42. ))
  43. (set @app-name (fileonly #app-name))
  44.  
  45.  
  46. ; Ask where to install to
  47.  
  48. (set #default-dest
  49.    (askdir
  50.       (prompt (#askdir-prompt @app-name))
  51.       (default @default-dest)
  52.       (help @askdir-help)
  53.       (disk)
  54.    )
  55. )
  56.  
  57. (set @default-dest #default-dest)
  58.  
  59.  
  60. ; Translate Atari 2600 program
  61.  
  62. (working #translating-msg)
  63. (if
  64.    (<> 0
  65.       (run
  66.          ("Stack 100000\nElectrostatic \"games/%s\""
  67.             (tackon @app-name "program")
  68.          )
  69.       )
  70.    )
  71.    (abort #disassembly-error-msg)
  72. )
  73.  
  74.  
  75. ; Copy assembly file to T and delete it from the current directory
  76.  
  77. (copyfiles
  78.    (source (cat @app-name ".asm"))
  79.    (dest "T:")
  80.    (nogauge)
  81.    (help @copyfiles-help)
  82. )
  83.  
  84. (delete (cat @app-name ".asm"))
  85.  
  86.  
  87. ; Assemble Atari 2600 program
  88.  
  89. (if
  90.    (<> 0
  91.       (run
  92.          ("GigaPhxAss QUIET \"T:%s.asm\" TO \"%s\""
  93.             @app-name
  94.             (tackon @default-dest @app-name)
  95.          )
  96.       )
  97.    )
  98.    (abort #assembly-error-msg)
  99. )
  100.  
  101.  
  102. ; Copy an icon for the translated program if one doesn't already exist
  103.  
  104. (if
  105.    (not (exists (tackon @default-dest (cat @app-name ".info"))))
  106.    (copyfiles
  107.       (source "Icons/Game Icon.info")
  108.       (dest @default-dest)
  109.       (newname (cat @app-name ".info"))
  110.       (nogauge)
  111.       (help @copyfiles-help)
  112.    )
  113. )
  114.  
  115.  
  116. ; Exit the script
  117.  
  118. (exit (#exit-msg @app-name @default-dest) (quiet))
  119.  
  120.  
  121. ; Make sure the standard welcome screen never appears
  122.  
  123. (welcome)
  124.  
  125.  
  126.